﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace Shipwire.Messages
{
    public class RateResponse : ShipwireResponse
    {
        public RateOrderResponse Order { get; set; }
    }

    public class RateOrderResponse
    {
        [XmlArray("Quotes")]
        [XmlArrayItem("Quote")]
        public RateQuote[] Quotes { get; set; }
    }

    public class RateQuote
    {
        [XmlAttribute("method")]
        public string Method { get; set; }

        public Warehouse Warehouse { get; set; }
        public string Service { get; set; }
        public Cost Cost { get; set; }
        public DeliveryEstimate DeliveryEstimate { get; set; }
    }

    public class DeliveryEstimate
    {
        public UnitOfTime Minimum { get; set; }
        public UnitOfTime Maximum { get; set; }
    }

    public class Cost
    {
        [XmlAttribute("currency")]
        public string Currency { get; set; }
        [XmlText]
        public decimal Value { get; set; }
    }

    public class UnitOfTime
    {
        [XmlAttribute("units")]
        public string Units { get; set; }
        [XmlText]
        public int Value { get; set; }
    }

}
